package com.example.service.Impl;

import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private RedisTemplate<Object,Object> redisTemplate;

    @Override
    public void put(String key, String value) {
//        redisTemplate.opsForSet().add(key,value);
        redisTemplate.opsForValue().set(key,value);
    }

//    @Override
//    public Object get(String key) {
//
//       return redisTemplate.opsForValue().get(key);
//
//    }
    @Override
    public String get(String key) {
        String count = (String) redisTemplate.opsForValue().get(key);
        return count;
    }
}
